package com.lely.controller;

import com.lely.feign.TestFeignService;
import com.lely.result.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lely
 * @date 2021/4/15 11:24
 */
@RestController
@RequestMapping("/test")
public class ATestController {

    @Autowired
    private TestFeignService testFeignService;

    /**
     * note: 测试 sentinel 的方式
     * @param id
     * @return
     */
    @GetMapping("/sentinel/{id}")
    public Response getRole(@PathVariable("id") Long id) {
        return new Response("200", "暂无数据", null);
    }

    /**
     * note: 测试 sentinel 的方式
     * @return
     */
    @GetMapping("/test")
    public String getFeign() {
        return testFeignService.test();
    }
}
